const { defineConfig } = require('@vue/cli-service')

module.exports = defineConfig({
  transpileDependencies: true,
  
  // 配置静态资源
  publicPath: '/',
  
  // 配置输出目录
  outputDir: 'dist',
  
  // 配置静态资源目录
  assetsDir: 'static',
  
  devServer: {
    proxy: {
      '/api': {
        target: 'http://localhost:8081',
        changeOrigin: true,
        pathRewrite: {
          '^/api': ''
        }
      }
    },

    port: 3030,

    client: {
      overlay: false
    },

    compress: false,
    
    // 确保静态文件正确服务
    static: {
      directory: require('path').join(__dirname, 'public'),
      publicPath: '/'
    }
  },
})